package com.ruoyi.youtobe.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.youtobe.domain.YoutobeChannelInfo;
import com.ruoyi.youtobe.mapper.YoutobeChannelInfoMapper;
import com.ruoyi.youtobe.service.IYoutobeChannelInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Youtobe频道信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-11-15
 */
@Service
public class YoutobeChannelInfoServiceImpl implements IYoutobeChannelInfoService {
    @Autowired
    private YoutobeChannelInfoMapper youtobeChannelInfoMapper;

    /**
     * 查询Youtobe频道信息
     *
     * @param id Youtobe频道信息主键
     * @return Youtobe频道信息
     */
    @Override
    public YoutobeChannelInfo selectYoutobeChannelInfoById(Long id) {
        return youtobeChannelInfoMapper.selectYoutobeChannelInfoById(id);
    }

    /**
     * 查询Youtobe频道信息列表
     *
     * @param youtobeChannelInfo Youtobe频道信息
     * @return Youtobe频道信息
     */
    @Override
    public List<YoutobeChannelInfo> selectYoutobeChannelInfoList(YoutobeChannelInfo youtobeChannelInfo) {
        return youtobeChannelInfoMapper.selectYoutobeChannelInfoList(youtobeChannelInfo);
    }

    /**
     * 新增Youtobe频道信息
     *
     * @param youtobeChannelInfo Youtobe频道信息
     * @return 结果
     */
    @Override
    public int insertYoutobeChannelInfo(YoutobeChannelInfo youtobeChannelInfo) {
        youtobeChannelInfo.setCreateTime(DateUtils.getNowDate());
        return youtobeChannelInfoMapper.insertYoutobeChannelInfo(youtobeChannelInfo);
    }

    /**
     * 修改Youtobe频道信息
     *
     * @param youtobeChannelInfo Youtobe频道信息
     * @return 结果
     */
    @Override
    public int updateYoutobeChannelInfo(YoutobeChannelInfo youtobeChannelInfo) {
        youtobeChannelInfo.setUpdateTime(DateUtils.getNowDate());
        return youtobeChannelInfoMapper.updateYoutobeChannelInfo(youtobeChannelInfo);
    }

    /**
     * 批量删除Youtobe频道信息
     *
     * @param ids 需要删除的Youtobe频道信息主键
     * @return 结果
     */
    @Override
    public int deleteYoutobeChannelInfoByIds(Long[] ids) {
        return youtobeChannelInfoMapper.deleteYoutobeChannelInfoByIds(ids);
    }

    /**
     * 删除Youtobe频道信息信息
     *
     * @param id Youtobe频道信息主键
     * @return 结果
     */
    @Override
    public int deleteYoutobeChannelInfoById(Long id) {
        return youtobeChannelInfoMapper.deleteYoutobeChannelInfoById(id);
    }
}
